<?php
include dirname(dirname(__FILE__)).'/admin-verify.php';
include dirname(__FILE__).'/functions.php';
?>
<html>
<head>
	<?php include dirname(dirname(dirname(__FILE__))).'/include/common-header.php'; ?>
	<?php
		if(isset($_POST['submit'])) {
			$content = $_POST['content'];
			$user_id = $_SESSION['user_id'];
			if(updateAidRule($content,$user_id)) {
				echo '<script type="text/javascript">
						alert("修改资助申请流程成功！");
					 window.location="../aid-manage/index.php";
					 </script>';
			}
		}
	?>				
	<script type="text/javascript" src="../../ckeditor/ckeditor.js"></script>
</head>
<body>
	<div class="col-md-12">
		<div>
			<h3>编辑资助申请流程</h3>
		</div>
		<div>
			<form method="post" action=<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>>
		        <textarea id="content" name="content">
		        	<?php
		        		$user_rule = getAidRule();
		        		echo $user_rule['content'];
		        	?>
		        </textarea>
		        <script type="text/javascript">
		            CKEDITOR.replace( 'content' , {
		            	width:800,
		            	height:500
		            });
		        </script>
	            <input type="submit" class="btn btn-primary" name="submit" style="margin-top:40px;" value="确认修改" />
	    	</form>
		</div>
	</div>
</body>
</html>